<template>
  <div class="outer">
    <div class="body" @click="detail">
      <div class="content">
        <img :src="this.image" alt="" class="img" />
      </div>
      <div class="title">{{ this.title }}</div>
      <div class="time">{{this.time}}</div>
    </div>
  </div>
</template>

<script>
export default {
  name: "newscard",
  props: ["title", "image", "newsSrc","time"],
  data() {
    return {};
  },
  methods: {
    detail() {
      this.$router.push({ name: "newsDetail", params: { news: this.newsSrc } });
      // this.$router.push(this.newsSrc)
    },
  },
};
</script>

<style>
.outer {
  width: 85%;
  font-size: 13px;
  background-color: #fff;
  margin: 0 auto;
  border-radius: 5px;
  box-shadow: 5px 5px 5px #b3afaf;
}
.title {
  text-align: left;
  margin-left: 15px;
}
.img {
  border-radius: 5px;
  margin-top: 10px;
  width:100%;
  box-shadow: 2px 2px 5px #b3afaf;
}
.time{
  /* float:right; */
  text-align: right;
}
</style>
